/*
 *  Reference.cpp
 *  Reference
 *
 *  Created by Hamza SHAWY and Jonathan SCHRODER on 10/10/07.
 *  Copyright 2007 __MyCompanyName__. All rights reserved.
 *
 */

#include "Reference.h"

 #include <iostream>
 #include <iomanip>
 
 using std::cout;
 using std::endl;



/* Definition of the default constructor  "Reference" of the class "Reference" */ 
    Reference::Reference():
    Identifier(-1), YearOfPublication(-1), Title("<undefined yet>"), Author("<undefined yet>") 
	{} // end Reference default constructor

/* Definition of the regular constructor  "Reference"  */     
	Reference::Reference(int id, int year, string author, string title):
	Identifier(id), YearOfPublication (year), Author (author), Title (title)
	{}// end Reference regular constructor
	
/* Definition of the copy constructor  "Reference"  */     
	Reference::Reference( const Reference & rfr ):
	Identifier(rfr.Identifier), YearOfPublication (rfr.YearOfPublication), Author (rfr.Author), Title (rfr.Title)
	{}// end Reference copy constructor	
															  
/*  Definition of the dedstructor  "~Reference" of the class "Reference"  */ 
    Reference::~Reference()    
	{} // end Reference destructor	 

/*  Definition of the method "getId" of the class "Reference"  */    
    int Reference::getId() const
	  {
        return Identifier; //returns the identifier of the reference
	  } // end function getId
	  
/*  Definition of the method "getYearOfPublication" of the class "Reference"  */    
    int Reference::getYearOfPublication() const
	  {
        return YearOfPublication ; //returns the year of oublication of the reference
	  } // end function getYearOfPublication	  
	  
/*  Definition of the method "getAuthor" of the class "Reference"	*/																																																																								  
	string Reference::getAuthor() const
	  {
        return Author ; //returns the author
	  } // end function getAuthor	
	  
/*  Definition of the method "getTitle" of the class "Reference"	*/																																																																								  
	string Reference::getTitle() const
	  {
        return Title ; //returns the title
	  } // end function getTitle			  

/*  Definition of the method "print" of the class "Reference"	*/																																																																								  
	void Reference::print() const  //prints a string representation of this Reference consisting of the id number, reference title, author and year of publication; 
	  {
        cout <<  "         * The object instance of the class Reference [or the object instance of the sub-class of Reference] is specified by its : "<< endl; 
		cout <<  "						1) Identifier number which is : "<< getId()<<endl;
		cout <<  "						2) Reference title which is : "<< getTitle()<<endl;
		cout <<  "						3) Author who is : "<< getAuthor()<<endl;
		cout <<  "						4) Year of ublication which is : "<< getYearOfPublication()<<endl;
	  } // end function print	 

	
/*  Definition of the member function "setIdentifier" of the class "Reference" */     
    void Reference::setId( int id )  // Sets the reference's identifier                
    {                                                           
       Identifier = id;                     
	} // end function setIdentifier

/* Definition of the member function "setYearOfPublication" of the class "Reference" */     
    void Reference::setYearOfPublication( int year )  // Sets the reference's year of publication                  
    {                                                           
       YearOfPublication = year;                     
	} // end function setYearOfPublication 
	
/* Definition of the member function "setAuthor" of the class "Reference" */     
    void Reference::setAuthor( string author )  // Sets the reference's author                  
    {                                                           
       Author = author;                     
	} // end function setAuthor 
	
/* Definition of the member function "setTitle" of the class "Reference" */     
    void Reference::setTitle( string title )  // Sets the reference's title                  
    {                                                           
       Title = title;                     
	} // end function setTitle
	
	
	